package com.infore.statisticsAndAlarm.controller;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.infore.statisticsAndAlarm.bo.DatasChartsBo;
import com.infore.statisticsAndAlarm.service.IDataCharsService;
import com.infore.statisticsAndAlarm.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "数据图表控制器", tags = { "数据图表控制器" })
@RestController
@RequestMapping("/dataCharts")
public class DataChartsController {

	@Autowired
	private IDataCharsService iDataCharsService;

	@ApiOperation(value = "断面单参趋势变化--通用接口")
	@GetMapping(value = "/singleDatasCharts")
	public ResultEntity singleDatasCharts(DatasChartsBo bo) {
		return iDataCharsService.singleDatasCharts(bo);
	}

	@ApiOperation(value = "断面多参趋势变化--通用接口")
	@GetMapping(value = "/moreDatasCharts")
	public ResultEntity moreDatasCharts(DatasChartsBo bo) {
		return iDataCharsService.singleDatasCharts(bo);
	}

	@ApiOperation(value = "断面趋势变化-散点图")
	@GetMapping(value = "/scatterPointCharts")
	public ResultEntity scatterPointCharts(DatasChartsBo bo) {
		return iDataCharsService.scatterPointCharts(bo);
	}

	@ApiOperation(value = "断面趋势变化-区块图")
	@GetMapping(value = "/singleDatablockCharts")
	public ResultEntity singleDatablockCharts(DatasChartsBo bo) {
		return iDataCharsService.singleDatablockCharts(bo);
	}

	@ApiOperation(value = "断面单参趋势变化-同比环比图")
	@GetMapping(value = "/annualRatioCharts")
	public ResultEntity annualRatioCharts(DatasChartsBo bo) {
		return iDataCharsService.annualRatioCharts(bo);
	}

	@ApiOperation(value = "获取行转列小时数据", notes = "获取选定时间范围的行转列小时数据")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "mn", value = "站点mn号", paramType = "query", required = true, dataType = "String"),
			@ApiImplicitParam(name = "codes", value = "因子", paramType = "query", required = true, dataType = "String"),
			@ApiImplicitParam(name = "beginTime", value = "开始时间", paramType = "query", required = true, dataType = "String"),
			@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", required = true, dataType = "String"),
			@ApiImplicitParam(name = "isNnusual", value = "是否查看异常数据all全部数据，unusual异常数据，normal正常数据", paramType = "query", required = true, dataType = "String") })
	@GetMapping(value = "/queryRowToColHourDataCharts")
	public ResultEntity queryRowToColHourDataCharts(String mn,String codes ,String beginTime, String endTime, String isNnusual) throws IOException {
		return iDataCharsService.queryRowToColHourDataCharts(mn, codes,beginTime, endTime, isNnusual);
	}
}
